<template>
    <div class="bodyCont">
        <div style="text-align:center;">
            <input type="text" class="inputPhoneNum" readonly v-model="phoneNum" maxlength="11" />
        </div>
        <!--充值流量数据列表-->
        <div>
            <div class="itemList" v-for="item in trafficList" v-bind:key="item.index" @click="recharge(item.value)">
                <span style="flex: 1;">{{item.name}}</span>
                <span style="flex: 2;">{{item.desc}}</span>
                <span style="flex: 1;">{{item.text}}</span>
            </div>
        </div>
    </div>
</template>

<script>
export default{
    name: 'mobileRechargeTrafficDetail',
    data() {
        return {
            name: 'mobileRechargeTrafficDetail',
            phoneNum: '',
            trafficList: [
                {
                    name: '5G流量',
                    desc: '当月有效',
                    value: '5',
                    text: '5元'
                },
                {
                    name: '10G流量',
                    desc: '仅在当月有效',
                    value: '10',
                    text: '10元'
                }
            ]
        }
    },
    methods: {
        recharge (value) {
            console.log(value);
            // 去支付！！！
            // order/payOrder.vue line-164  wechatPay() 走微信支付[移动支付参考]
        },
    },
    mounted() {
        let queryString = this.$route.query;
        this.phoneNum = queryString.phoneNum
    }
}
</script>

<style lang="scss" scoped>
.bodyCont{
    height: 100%;
    background: #fff;
    padding: 20px;
    .inputPhoneNum{
        background: #ddd;
        border: none;
        line-height: 3;
        width: 80%;
        padding: 0 20px;
        color: #ff5400;
        font-weight: bold;
        /*font-size: x-large;*/
    }
    .nextSteps{
        width: 80%;
        margin: 20px auto;
        background: #ff5400;
        color: #fff;
        line-height: 3;
    }
    .warmText{
        font-size: 12px;
        color: #ddd;
        text-align: center;
        width: 100%;
        display: block;
    }
    .itemList{
        width: 80%;
        padding: 10px 0;
        border: 1px solid #ddd;
        border-radius: 8px;
        margin: 10px auto;
        background: #fcfcfc;
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        font-size: 14px;
        text-align: center;
        color: #ff5400;
        font-weight:bold;
        span:nth-child(2){
            font-size:12px;
            text-align:right;
            color:#333;
        }
    }
}
</style>
